<!DOCTYPE html>
<html lang='en'>
    <head>
        <meta charset='UTF-8'>
        <title>demo</title>
    </head>
    <body ng-app='myApp'>
        <div ng-controller='myController'>
            <input type="text" ng-model="a">
            <input type="text" ng-model="b">
            {{(a-0) + (b-0)}}
            <br>
            {{getResult()}}
        </div>
        <script src='libs/angular.js'></script>
        <script>
            var app = angular.module('myApp',[]);
            app.controller('myController',function($scope){
                //getResult计算属性
                $scope.getResult = function(){
                    return ($scope.a-0) + ($scope.b-0);
                }
            })
        
        </script>
    </body>
</html> 